<div class="form-group"><label class="col-sm-2 control-label">{$form.title}</label>
    <div class="col-sm-10">
    	<label class="css-input switch switch-sm switch-primary push-10-t">
            <input id="{$form.name}" type="checkbox" data-table="admin_config" data-id="1" data-field="value" class="switch_post_{$form.name}" value="true"
            {if condition="$form.value=='true'"}checked{/if} name="{$form.name}"
            {volist name="form.attr" id="option"}{$key}="{$option}" {/volist}><span></span>
        </label>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
            $('.switch_post_{$form.name}').click(function () {
                var data={};
                {volist name="form.attr" id="option"}
                    data.{$key}=$(this).attr("{$key}");
                {/volist}
                data.value=this.checked;
                data.name='{$form.name}';
                if(undefined != data.action){
                    app.post(data.action,data);
                    return true;
                }else{
                    return true;
                }
            });
        });
</script>